<template>
    <YvRow class="yv-modal" v-show="modalVisible" @click.self="hide" align="center">
        <YvCol ref="modal-body" :span="20" :sm="35" class="yv-modal-body">
            <div class="yv-modal-header">
                <slot name="header">

                </slot>
            </div>
            <div class="yv-modal-content">
                <slot></slot>
            </div>
            <div class="yv-modal-footer">
                <slot name="footer"></slot>
            </div>
        </YvCol>
    </YvRow>
</template>

<script>
export default {
    name: 'YvModal',
    props: {
    },
    data() {
        return {
            modalVisible: false,
        }
    },
    methods: {
        show() {
            this.modalVisible = true;
            this.$emit('show')
        },
        hide() {
            this.modalVisible = false;
            this.$emit('hide')
        }
    },

}
</script>

<style>
.yv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.2);
    z-index: 100000000;
}

.yv-modal-body {
    position: fixed;
    border: 1pt solid rgba(182, 182, 182);
    border-radius: 2%;
    background: white;
    top: 5%;
    height: 80%;
}
</style>